<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:a4j="http://richfaces.org/a4j"       
      xmlns:rich="http://richfaces.org/rich"
      xmlns:f="http://java.sun.com/jsf/core" >
  
    <h:head>

	<meta http-equiv="content-type" content="text/html; charset=utf-8" />	


	<!--  Estils per defecte -->
	<link rel="stylesheet" href="/css/style.css" type="text/css" media="print, projection, screen" />	
 
	<script src="http://code.jquery.com/jquery-latest.js"/>


	<rich:jQuery selector="#dyn_taulaInmoblesVenedor tr:odd" query="addClass('odd-row')" />
    <rich:jQuery selector="#dyn_taulaInmoblesVenedor tr:even" query="addClass('even-row')" />
    <rich:jQuery selector="#dyn_taulaInmoblesVenedor tr" query="mouseover(function(){jQuery(this).addClass('active-row')})"/>
	<rich:jQuery selector="#dyn_taulaInmoblesVenedor tr" query="mouseout(function(){jQuery(this).removeClass('active-row')})"/>



	<!-- TABLESORTER / JQUERY 
	<h:outputStylesheet name="jq.css" library="jQuery/tablesorter/docs/css"></h:outputStylesheet>	
	<h:outputStylesheet name="style.css" library="jQuery/tablesorter/themes/blue"></h:outputStylesheet>		
	
	<h:outputScript name="jquery-latest.js" library="jQuery/tablesorter"></h:outputScript>
	<h:outputScript name="jquery.tablesorter.js" library="jQuery/tablesorter"></h:outputScript>
	<h:outputScript name="jquery-latest.js" library="jQuery/tablesorter/js/chili"></h:outputScript>
	<h:outputScript name="docs.js" library="jQuery/tablesorter/docs/js"></h:outputScript>
-->
	

	<!-- FLEXIGRID / JQUERY 
	<h:outputStylesheet name="flexigrid.pack.css" library="jQuery/flexigrid/css"></h:outputStylesheet>
	
	<h:outputScript name="flexigrid.pack.js" library="jQuery/flexigrid/js"></h:outputScript>        
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.jss"></script>          
	-->
	
	
	<!-- DATATABLES / JQUERY 	
	<h:outputStylesheet name="demo_page.css" library="jQuery/DataTables-1.9.0/media/css"></h:outputStylesheet>
	<h:outputStylesheet name="demo_table.css" library="jQuery/DataTables-1.9.0/media/css"></h:outputStylesheet>
	
	<h:outputScript name="jquery.dataTables.js" library="jQuery/DataTables-1.9.0/media/js"></h:outputScript> 		
	-->
	<!-- NO FUNCIONA
	<h:outputScript name="jquery.js" library="jQuery/DataTables-1.9.0/media/js"></h:outputScript>
	--> 

	
<script type="text/javascript">

$j = jQuery.noConflict();   // IMPORTANT !!!!!!! PER EVITAR CONFLICTE AMB RICHFACES UTILITZEM LA FUNCIO JQUERY noConflict


$j(document).ready(function() {

	// --------------------------------------------------------------------------
	// Apliquem el plugin jQuery tableSorter a la taula			
	// --------------------------------------------------------------------------
	//$j("#formulariDatatable\\:dyn_taulaInmoblesVenedor").tablesorter();
	//$j('#formulariDatatable\\:dyn_taulaInmoblesVenedor').dataTable();


	// --------------------------------------------------------------------------
	// TRACTAMENT DE VISIBILITZAR/INVISIBILITZAR COLUMNES A PARTIR DELS CHECKBOXS
	// --------------------------------------------------------------------------  
	$j('input[type="checkbox"]').click(function() {
		 
        var indexCol = Number($j(this).attr('name').substr(26));  // formulariInmoble:checkbox_12 = columna 12 
      
        $j('#formulariDatatable\\:dyn_taulaInmoblesVenedor tr').each(function(index) {

        	 // OPCIO 0 : COLOREJAR UNA CELLA A PARTIR DEL NOM DEL CONTROL
        	 // EN AQUEST CAS "column_X" 
        	 // UTILITZANT COM A ID DEL CHECKBOX L'ID DE LA CARACTERISTICA (8, 13, 21,...)
        	 //$j('#formulariDatatable\\:dyn_taulaInmoblesVenedor\\:column_' + indexCol,this).css("color", "black");  // oculta la cela "index"


        	// OPCIO 1 : OCULTAR COLUMNA TAULA 
       	 	// UTILITZANT COM A ID DEL CHECKBOX UN COMPTADOR DE COLUMNA (1,2,3,....) 
   			//$j('td:eq(' + indexCol + ')',this).toggle('fast');  // oculta el th de la cela "index"
   			//$j('th:eq(' + indexCol + ')',this).toggle('fast');  // oculta el th de la cela "index"


   			// OPCIO 3 : OCULTAR COLUMNA TAULA 
      		// AMB UNA SOLA LINIA I UTILITZANT COM A ID L'ID DE LA CARACTERISTICA (EX: BANYS -> 7 )
      		// EL each CONTE L'INDEX DEL LOOP QUE EN AQUEST CAS ENS MARCA LA TD DE LA COLUMNA QUE 
      		// VOLEM ESBORRAR  
			 $j("#formulariDatatable\\:dyn_taulaInmoblesVenedor\\:" + index + "\\:column_" + indexCol).toggle('fast'); 
	        });

        

      	// OPCIO 2 : OCULTAR COLUMNA TAULA 
      	// AMB UNA SOLA LINIA I UTILITZANT COM A ID DEL CHECKBOX UN COMPTADOR DE COLUMNA (1,2,3,....) 
		///////////$j('#formulariDatatable\\:dyn_taulaInmoblesVenedor td:nth-child(' + indexCol + '),th:nth-child(' + indexCol + ')').toggle('fast');  

     	// OPCIO 3 : OCULTAR COLUMNA TAULA 
      	// AMB UNA SOLA LINIA I UTILITZANT COM A ID L'ID DE LA CARACTERISTICA (EX: BANYS -> 7 )  
		
		$j("#formulariDatatable\\:dyn_taulaInmoblesVenedor\\:column_" + indexCol).toggle('fast'); 


		$j('#formulariDatatable\\:dyn_taulaInmobles tr').each(function(index2) {

       	 	 $j("#formulariDatatable\\:dyn_taulaInmobles\\:" + index2 + "\\:columnSortFilter_" + indexCol).toggle('fast'); 
	        });
		
		$j("#formulariDatatable\\:dyn_taulaInmobles\\:columnSortFilter_" + indexCol).toggle('fast'); 
        
	        
    }); 
}); 


 </script>
 	




	<!--[if IE]>
	<script type="text/javascript" src="/js/excanvas.compiled.js"></script>
	<script type="text/javascript" src="/js/excanvas.js"></script>
	<script type="text/javascript" src="/js/canvas1.js"></script>
	<script type="text/javascript" src="/js/canvas2.js"></script>
	<![endif]-->
	<script type="text/javascript" src="/js/canvas1.js"></script>
	<script type="text/javascript" src="/js/canvas2.js"></script>

     
    	
	<style>
		canvas {
			border:1px solid #444;
		}
	</style>
    
    
		
    </h:head>
 
  
    <h:body>
    
    
   <h:outputStylesheet> 
			a.no-decor>img { border: none; } 
			.even-row {     background-color: #FCFFFE; }   
			.odd-row {     background-color: #ECF3FE; }   
			.active-row {     background-color: #FFEBDA !important;     
								cursor: pointer; }
			.lsize{font-size : 10px;} 
			.visitat {     background-color: #ECF3FE; }
			.novisitat {     background-color: #FCFFFE; }
			
			
  
	 
			<!-- DragAndDrop --> 
			.limitedHeightDiv {height: 200px; 
		   						overflow: auto;	} 
	 
	      
			 .panelc { width:35%; }         
			 .valign { vertical-align:top; }         
			 .dropTargetPanel { width: 90%; }         
			 .footerClass {             
			 	text-align: center;             
			 	padding-top: 5px;         
		 	}
		 	                   
			.default{             
		 	font-size:11px;             
			cursor:pointer;             
		 	width:300px;             
			border:1px solid gray;             
			padding:2px         
			}          
			 
		 .rf-ind-drag.default{             
		 	padding-left:30px;              
		 	background-image: url("#{facesContext.externalContext.requestContextPath}/images/bSaveNR.gif");
			background-position: 5px;             
			background-repeat: no-repeat;         
			}         
			
		.rf-ind-drag.accept{             
			background-image: url("#{facesContext.externalContext.requestContextPath}/images/24-book-blue-add.png");            
			background-position: 5px;             
			background-repeat: no-repeat;
			border:1px solid gray;         
			}
			          
		.rf-ind-drag.reject{             
			border:2px solid red;             
			background-image: url("#{facesContext.externalContext.requestContextPath}/images/16-em-cross.png");             
			background-position: 5px;             
			background-repeat: no-repeat;         
			}
			
			
		.rf-ind-drag{
			font-size:11px;
			cursor:pointer;
			width:100px;
			border:1px solid gray;
			padding:2px
			}
			  
			.vermell{color:red;}
			.verd{color:green;font-size:16px;}
		</h:outputStylesheet> 
	
 
	<f:loadBundle var="missatge" basename="idioma"/>

		<a4j:status onstart="#{rich:component('statPane')}.show()"        
   		onstop="#{rich:component('statPane')}.hide()" />
   		 
   		<rich:popupPanel id="statPane" autosized="true">         
      		Espera ...     
      	</rich:popupPanel>  
    
 
		<ui:insert name="header" >
			<ui:include src="/templates/common/commonHeader.xhtml" />
		</ui:insert>
	    
		<h:panelGrid columns="2" >
			
			<h:panelGroup>
				<ui:insert name="loginMenu" >
					<ui:include src="/xhtml/login.xhtml"/>
					<ui:include src="/xhtml/menu.xhtml"/>
				</ui:insert>
			</h:panelGroup>
			
  			<h:panelGroup>
    			<ui:insert name="body">
    			
    				<ui:include src="/xhtml/presentacio.xhtml"/>	
    			
    			</ui:insert>
    		</h:panelGroup>
    		
    	</h:panelGrid>
	    
 
 		<ui:insert name="footer" >
			<ui:include src="/templates/common/commonFooter.xhtml" />
		</ui:insert>
	
 
    </h:body>
    
    
</html>